package minimumPossibleSum;

import java.util.HashSet;
import java.util.Set;

public class Solution {
    public long minimumPossibleSum(int n, int target) {
        long sum = 0;
        int i = 0;
        int t = 1;
        Set<Integer>set = new HashSet<>();
        while (i<n) {
            if(!set.contains(target-t)) {
                set.add(t);
                i++;
                sum+=t;
            }
            t++;
        }
        return sum;
    }
}